import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * User: zm
 * Date: 2023/9/22
 */
public class Demo19 {
    static int N = 1000010,n,cnt;
    static int[] primes = new int[N];
    static boolean[]  st = new boolean[N];
    public static void get_primes(int n){
        for(int i = 2; i <= n; i++){
            if(!st[i])primes[cnt++] = i;
            for(int j = 0; primes[j] <= n / i; j++){
                st[primes[j] * i] = true;
                if(i % primes[j] == 0)break;
            }
        }
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        get_primes(n);
        System.out.println(cnt);
    }
}
